<template>
  <el-form :model="searchInfo" label-width="160px" class="pms-details" size="mini" :inline="true">
    <el-row :gutter="24">
      <el-col :span="6">
        <el-form-item label="物料编码" prop="categoryCode">
          <el-input v-model="searchInfo.categoryCode" placeholder="" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="物料名称" prop="categoryName">
          <el-input v-model="searchInfo.categoryName" placeholder="" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item class="button-group">
          <el-button type="primary" class="white-color pms-button-primary" @click="handleSearch">查询</el-button>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
export default {
  name: 'Prjbasedetail',
  props: ['selectList'],
  data() {
    return {
      searchInfo: {
        categoryCode: '',
        categoryName: '',
        sonPrjCode: ''
      }
    }
  },
  computed: {
    // 整体项目展示项目编码其他都不展示
    getManageMode() {
      if (this.$route.query?.manageMode === '03') {
        return true
      } else {
        return false
      }
    }
  },
  methods: {
    handleSearch() {
      this.$emit('search', this.searchInfo)
    },
    handleReset() {
      this.searchInfo.categoryCode = ''
      this.searchInfo.categoryName = ''
      // 项目编码
      this.searchInfo.sonPrjCode = ''
      this.$emit('search', this.searchInfo)
    }
  }
}
</script>
<style scoped lang="scss">
.pms-form {
  padding-left: 0px;
  padding-right: 0px;
}

.white-color {
  color: #fff;
}

.button-group {
  position: relative;
  height: 100%;
  line-height: 32px;

  ::v-deep {
    .el-form-item__content {
      display: flex;
      justify-content: flex-end;
      width: 100%;
    }
  }

  .pms-button-color {
    background: #fff !important;
  }

  .pms-button-color:hover {
    background: #ffffff !important;
    border-color: #ef6f6f !important;
    border: 1px solid #ef6f6f !important;
    color: #ef6f6f !important;
  }

  .pms-button-color:focus {
    background: #ffffff !important;
    border-color: #ef6f6f !important;
    border: 1px solid #ef6f6f !important;
    color: #ef6f6f !important;
  }
}
</style>
